{extend name="public/base" /} {block name="body"}
<div class="content-tabs">
	<ol class="breadcrumb">
		<li>
			<a href="{:url('index/index')}"><i class="fa fa-home"></i></a>
		</li>
		<li>
			<a href="{:url('index')}">房台管理</a>
		</li>
		<li><strong>编辑房台</strong></li>
	</ol>
</div>
<div class="row">
	<div class="col-sm-12">
		<div class="ibox float-e-margins">
			<div class="ibox-content">
				<form id="myForm" class="form-horizontal m-t" method="post" action="{:url('edit')}">
					<input type="hidden" name="id" value="{$model.id}">
					<div class="form-group">
						<label class="col-sm-3 control-label">房台名称：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="table_name" name="table_name" value="{$model.table_name}" placeholder="房台名称" class="form-control" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">所属分类：</label>
						<div class="input-group col-sm-4">
                           	<select class="form-control" name="table_typeid" id="table_typeid">
								<option value="0">默认分类</option>
								{volist name="typelist" id="vo"}
									<option value="{$vo.id}"  {if condition="$model.table_typeid==$vo.id" } selected="selected" {/if}>{$vo.type_name}	
									</option>
								{/volist}		
							</select>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">适用人数：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="scope_limit" name="scope_limit" value="{$model.scope_limit}" placeholder="适用人数" class="form-control" />
						</div>
					</div>
					<div class="form-group">
							<label class="col-sm-3 control-label">状态：</label>
							<div class="input-group col-sm-3">
							<input type="radio" name="status" value="1" {if $model.status==1} {php echo checked="true"} {/if}/> 正常
							&nbsp;
							<input type="radio" name="status" value="2" {if $model.status==2} {php echo checked="true"} {/if}/> 失效
							</div>
						</div>
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<label class="col-sm-3 control-label">排序：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="sort" name="sort" value="{$model.sort}" class="form-control" />
						</div>
					</div>
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<div class="col-sm-4 col-sm-offset-3">							
							<button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> 保存</button>&nbsp;&nbsp;
							<a href="{:url('index')}" class="btn btn-danger"><i class="fa fa-arrow-left"></i> 返回 </a>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
{/block} {block name="script"}
<script src="__JS__/jquery.form.js"></script>
<script src="__LIB__/validate/jquery.validate.min.js"></script>
<script src="__LIB__/validate/messages_zh.min.js"></script>
<script src="__LIB__/validate/add_validate.min.js"></script>
<script>
	$(function() {
		$("#myForm").validate({
			rules: {
				table_name: "required",
				scopeLimit: "required"
			},
			messages: {
				table_name: ICON.error + "请输入房台名称",
				scopeLimit: ICON.error + "请输入适用人数"
			},
			submitHandler: function(form) {
				ajaxForm();
			}
		});
	});
</script>
{/block}